package javase.array;

public class YangHuiSanJiao {
    public static void main(String[] args) {
        int[][] arr = new int[10][];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new int[i + 1];
            arr[i][0] = arr[i][i] = 1;
            for (int j = 1; j < arr[i].length - 1; j++) {
                arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
            }
        }
        for (int[] row : arr) {
            for (int element : row) {
                System.out.print(element);
            }
            System.out.println();
        }
    }
}
